{% extends "base.html" %}
{% load i18n %}
{% block title %} Tu Negocio Empresarios - Listar Clientes {% endblock %}
{% block head-css-ext %}
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/layout.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/blue/style.css" media="print, projection, screen" />
{% endblock %}

{% block head-js-ext %}
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablesorter.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablePagination.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.translate.js"></script>
{% endblock %}

{% block head-js-embedded %}
    <script type="text/javascript">
        $(document).ready(function(){
            var options = {
                firstArrow : (new Image()).src="{{MEDIA_URL}}img/icons/first.png",
                prevArrow : (new Image()).src="{{MEDIA_URL}}img/icons/prev.png",
                lastArrow : (new Image()).src="{{MEDIA_URL}}img/icons/last.png",
                nextArrow : (new Image()).src="{{MEDIA_URL}}img/icons/next.png"
            }
            $("#clientes")
                .tablesorter({widthFixed: true,  widgets: ['zebra'], headers : { 1 : { sorter: false }, 2 : { sorter: false }, 3 : { sorter: false }, 4 : { sorter: false }, 5 : { sorter: false }   } })
                .tablePagination(options);
		
            $("#tablePagination").translate('en', 'es');	  
        });        
    </script>
{% endblock %}

{% block content-box1 %}
    <b> Clientes de {{ usuario.first_name }} {{ usuario.last_name }} </b>
    <br><br>
    {% if clientes %}
        <table id="clientes" class="tablesorter">
            <thead>
                <tr align="center">
                    <th>Cliente</th>
                    <th>Editar Cliente</th>
                    <th>Agregar Nota Cliente</th>
                    <th>Ver Cliente</th>
                    <th>Ver Ventas Cliente</th>		    
                    <th>Ver Notas Cliente</th>
                </tr>            
            </thead>
            <tbody>
                {% for cliente in clientes %}
                    <tr align="center">
                        <td>{{ cliente }}</td>
                        <td><a href="{% url editar_cliente cliente.codigo %}" title="Editar Cliente"><img src="{{MEDIA_URL}}/img/pencil.png" border="0"/></a></td>
                        <td><a href="{% url agregar_nota_cliente cliente.codigo %}" title="Agregar Nota Cliente"><img src="{{MEDIA_URL}}/img/pencil.png" border="0"/></a></td>
                        <td><a href="{% url ver_cliente cliente.codigo %}" title="Ver Cliente"><img src="{{MEDIA_URL}}/img/zoom.png" border="0"/></a></td>
                        <td><a href="{% url ver_ventas_cliente cliente.codigo %}" title="Ver Ventas Cliente"><img src="{{MEDIA_URL}}/img/zoom.png" border="0"/></a></td>
                        <td><a href="{% url ver_notas_cliente cliente.codigo %}" title="Ver Notas Cliente"><img src="{{MEDIA_URL}}/img/zoom.png" border="0"/></a></td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p><b>No tiene clientes activos relacionados</b></p>
    {% endif %}
{% endblock %}

{% block content-colum2 %}
    {% if user.is_authenticated %}
        <ul>
            <li><a href="{% url index %}">{% trans "Home" %}</a></li>
            <li><a href="{% url clientes %}">Clientes</a></li>
            <li><a href="{% url agregar_clientes %}">Agregar Clientes</a></li>
            <li><a href="{% url pagos_clientes %}">Pagos Clientes</a></li>
        </ul>
    {% endif %}   
{% endblock %}